create or replace
TRIGGER UPGRADES_TRIGGER
BEFORE INSERT ON UPGRADES
FOR EACH ROW WHEN (NEW.UPGRADE_ID IS NULL)
BEGIN 
	SELECT UPGRADES_SEQ.NEXTVAL 
	INTO :NEW.UPGRADE_ID 
	FROM DUAL;
END;